<?php

namespace App\Http\Resources;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class Comments extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'customer' => Customers::make($this->customer),
            'content' => $this->content,
            'score' => $this->score,
            'level' => $this->level,
            'images' => $this->detail['images'],
            'product' => $this->detail['product'],
        ];
    }
}
